#!/usr/bin/python
# -*- coding=utf-8 -*-

from django.conf.urls import url
from tutorial import views

urlpatterns = [
	url(r'^$', views.index,  name="tutorial-index"),
	url(r'^django/$', views.django_index,  name="django-index"),
	url(r'^django/admin/$', views.django_admin,  name="django-admin"),

    #upload file tutorial test
	url(r'^django/view/upload/$', views.django_view_upload,  name="django-view-upload"),

    #download file tutorial test
	url(r'^django/view/download/$', views.django_view_dowload, kwargs={"status":"init"},  name="django-view-download"),


	#polls views

	# url(r'^poll/$', views.poll_index, name = "poll-index"),
	# url(r'^poll/(?P<question_id>\d+)$', views.poll_detail, name="poll-detail"),
	# url(r'^poll/(?P<question_id>\d+)/results/$', views.poll_results, name="poll-results"),
	# url(r'^poll/(?P<question_id>\d+)/vote/$', views.poll_vote, name="poll-vote"),

	#polls generic view
	# generic view accept a pk key argument as the object's key value
	url(r'^poll/$', views.PollIndexView.as_view(), name = "poll-index"),
	url(r'^poll/(?P<pk>\d+)$', views.PollDetailView.as_view(), name="poll-detail"),
	url(r'^poll/(?P<pk>\d+)/results/$', views.PollResultsView.as_view(), name="poll-results"),
	url(r'^poll/(?P<question_id>\d+)/vote/$', views.poll_vote, name="poll-vote"),

	#authentication test
	url(r'^login/$', views.login_view, name="tutorial-login"),

    url(r'^logout/$', views.logout_view, name="tutorial-logout"),

    # custome create user
	url(r'^register/$', views.register_view, name="tutorial-register"),


	#test model-related topics
	# url(r'^project/$', )

]
